package com.csxy.systemmanager.controller;

import com.csxy.systemmanager.common.ResponseResult;
import com.csxy.systemmanager.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class MenuController {
    @Autowired
    private MenuService menuService;

    //获取当前用户下所有的菜单
    @GetMapping("/menuList")
    public ResponseResult getMenuList(){
        return menuService.getMenuTree();
    }

    //获取当前用户下所有的菜单
    @GetMapping("/routes")
    public ResponseResult getRoutes(){
        return menuService.getRoutes();
    }
}
